CREATE TABLE test
(
id
int(11) unsigned NOT NULL AUTO_INCREMENT,
age
int(11) DEFAULT NULL,
PRIMARY KEY (id
)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
$t = new Test(); $t->id = 1; $t->create();
then log writes
SELECT IF(COUNT(*)>0, 1 , 0) FROM INFORMATION_SCHEMA
.TABLES
WHERE TABLE_NAME
='test'
DESCRIBE test
SELECT COUNT() "rowcount" FROM test
WHERE id
= ?
SELECT COUNT() "rowcount" FROM test
WHERE id
= ?
INSERT INTO test
(age
, id
) VALUES (?, ?)
if i use save() instend of create(), it's only once select